Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parametrization reload #983

Merged
merged 5 commits into from
Aug 17, 2023

Conversation

M6AI
Copy link
Contributor

@M6AI M6AI commented Aug 14, 2023

Bug / Requirement Description

Currently, the reload feature of the interactive UI does not capture changes to parametric testcases at parametrization level. In fact, changing any of the parameters will result in the old parameters possibly pointing to non-existent cases and the UI becomes hanging.

Solution description

Added parametrization level to the report reload so that changes to parametric testcases are captured.

Checklist:

  • Test
  • Example (both test_plan.py and .rst)
  • Documentation (API)
  • News fragment present for release notes
  • MS info leakage check
  • For new driver: driver index page
  • For new assertion: ui/pdf/std renderers, documentation
  • For new cmdline arg: documentation

@M6AI M6AI requested a review from Pyifan as a code owner August 14, 2023 14:27
.entries[new_case_index]
.uid
]
tc = new_report[mt.uid][st.uid].entries[new_case_index]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider to introduce temporary variables instead of those long indexing chains. Speaking names could make this more(euphemism) readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved most of it to enumerate.

kn-ms
kn-ms previously approved these changes Aug 14, 2023
except KeyError: # new testcase
pass
mt.entries[st_index] = new_st
if isinstance(case, TestGroupReport):
Copy link
Contributor

@Pyifan Pyifan Aug 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some test coverage for this change? To prevent future regression. Otherwise this looks great!

@M6AI M6AI force-pushed the bugfix/parametrization_reload branch from 1b3e577 to 42d0026 Compare August 15, 2023 17:31
# We reload and assert
irunner.reload_report()

for test in irunner.report:
Copy link
Contributor Author

@M6AI M6AI Aug 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pyifan In a nutshell, this test does the following:

  • ensures that runtime status actually moves to ready upon change (this is functionally irrelevant tho)
  • checks whether the original report state got restored (after alterations with new cases and parametrizations or removals of either) and whether everything at testcase level that was run and kept have been preserved under the reload

Seems smoother with public setters than mocking some behavior using proper mocks.

@M6AI M6AI merged commit 331ace2 into morganstanley:main Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants